package adv3;

import java.util.Arrays;
import java.util.Random;

/**
 * @author oldliu
 * @since 1.0
 */
public class RTest {
    public static void main(String[] args) {
        Random r=new Random();
        System.out.println("int:");
        for (int i = 0; i < 20; i++) {
            System.out.println(r.nextInt());
        }
        System.out.println("float:");
        for (int i = 0; i < 20; i++) {
            System.out.println(r.nextFloat());
        }
        System.out.println("boolean:");
        for (int i = 0; i < 20; i++) {
            System.out.println(r.nextBoolean());
        }
        System.out.println("double:");
        for (int i = 0; i < 20; i++) {
            System.out.println(r.nextDouble());
        }
        System.out.println("int 带范围（0-200）:");
        for (int i = 0; i < 20; i++) {
            System.out.println(r.nextInt(200));
        }
        System.out.println("byte数组:");
        byte []b=new byte[30];
        for (int i = 0; i < 20; i++) {
            r.nextBytes(b);
            System.out.println(Arrays.toString(b));
        }
    }
}
